﻿using System.Windows;
using System.Windows.Input;
using Lab1_BrooksPhillips.Controllers;
using Lab1_BrooksPhillips.Model;

namespace Lab1_BrooksPhillips
{
    /// <summary>
    /// The main Window of the demo app.
    /// </summary>
    public partial class XrayWindow : Window
    {
        #region Data

        readonly XrayWindowController _controller;

        #endregion // Data

        #region Constructor

        public XrayWindow()
        { 
            InitializeComponent();

            XrayCollection xrays = XrayCollection.Load();

            // Create the controller that  
            // handles user interaction.
            _controller = new XrayWindowController(this, xrays);

            // Use the list of Xray objects as 
            // this Window's data source.
            base.DataContext = xrays;
        }

        #endregion // Constructor

        #region Command Sinks

        // These methods handle events of  
        // the ShowSelectedXray command.

        void ShowSelectedXray_CanExecute(
            object sender, CanExecuteRoutedEventArgs e)
        {
            e.CanExecute = _controller.CanShowSelectedXray;
        }

        void ShowSelectedXray_Executed(
            object sender, ExecutedRoutedEventArgs e)
        {
            _controller.ShowSelectedXray();
        }

        #endregion // Command Sinks

        private void button3_Click(object sender, RoutedEventArgs e)
        {

        }

        private void TreeViewItem_Selected(object sender, RoutedEventArgs e)
        {

        }

        private void button8_Click(object sender, RoutedEventArgs e)
        {

        }

        private void tabControl2_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {

        }

        private void expander1_Expanded(object sender, RoutedEventArgs e)
        {

        }

        private void button10_Click(object sender, RoutedEventArgs e)
        {
            string messageBoxText = "Hola!";
            string caption = "KitchenThink_BrooksPhillips";
            MessageBoxButton button = MessageBoxButton.OK;
            MessageBoxImage icon = MessageBoxImage.Exclamation;
            MessageBox.Show(messageBoxText, caption, button, icon);


        }
        
    }
}